const template = `
	<div class="room" style="height: 100%;">
		<van-nav-bar
			  title="设备巡检明细"
			  left-arrow
				@click-left="onBack"
			/>
		<div class="patrol__inner" style="height: calc(100% - 50px);">
			<ul style="height: calc(100% - 70px);overflow: auto;">
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">0.56</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/温度.png" width="28" />
					<span class="point-name">空压机温度</span>
					<div class="point-value-wrapper">
						<span class="point-value">86</span>
						<span class="point-unit">℃</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/压力.png" width="32" />
					<span class="point-name">空压机总管压力</span>
					<div class="point-value-wrapper">
						<span class="point-value">1.25</span>
						<span class="point-unit">Mpa</span>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/鼓风机.png" width="32" />
					<span class="point-name">鼓风机皮带情况</span>
					<div class="point-value-wrapper point-di">
						<a @click="onPointClick('stop')" class="point-di-icon-wrapper" :class="{ active: state === 'stop' }">
							<van-icon name="stop-circle" />
							<span class="text">停止</span>
						</a>
						<a @click="onPointClick('play')" class="point-di-icon-wrapper" :class="{ active: state === 'play' }">
							<van-icon name="play-circle" style="margin: 0 16px;" />
							<span class="text">运行</span>
						</a>
						<a @click="onPointClick('fault')" class="point-di-icon-wrapper" :class="{ active: state === 'fault' }">
							<van-icon name="warning" />
							<span class="text">故障</span>
						</a>
					</div>
					<van-divider />
				</li>
				<li class="point-item">
					<img src="./assets/plugins/vant/theme/default/img/巡检备注.png" width="32" />
					<span class="point-name">巡检备注</span>
					<div class="point-value-wrapper">
						<textarea style="font-size: 13px;line-height:1;width: 200px;height: 40px;border: none;border-bottom: 1px solid #e8e8e8;"></textarea>
					</div>
					<van-divider />
				</li>
			</ul>
			
			<div style="position: absolute;left: 0;right: 0;bottom: 0;background: #fff;padding: 10px 0;">
				<van-button type="info" style="width: 80%;left: 10%;" round size="middle" @click="onSubmit">保存</van-button>
			</div>	
			
		</div>	
			
	</div>
`;

export default {
	props: {
		deviceId: {
			type: String,
		},
	},
	created() {
		// this.deviceId // 设备id
		console.log(this)
		// this.$toast(`${this.deviceId}`)
		// console.log(this.$root)
		// axios.get(`/patrolRecordMs/getMyOverTaskList/${this.$root.userId}/${this.$root.nickName}`).then(resp => {
		// 	if(resp.status === 200) {
		// 		this.list = resp.data.reduce((accu,v)=> {
		// 			accu.push({
		// 				id: v.id,
		// 				text: v.timePeriod,
		// 				finished: v.stateThisDay === '1', // 0未巡检，1已巡检
		// 			});
		// 			return accu;
		// 		}, []);
		// 	}
		// });
	},

	data() {
		return {
			state: 'play',
		}
	},
	methods: {
		onSubmit() {
			this.$toast(`submit`)
		},
		onBack() {
			this.$router.go(-1)
		},
		onPointClick(state) {
			this.state = state;
		}
	},

	template,

	components: {

	}
}
